//Main thread

//#pragma comment(lib,"pthreadVCE2.lib ")

#include <iostream>

#include <pthread.h>

#include "com_main.h"
#include "out_main.h"
#include "main.h"

using namespace std;


int main(int argc, char *argv[]){
	pthread_t th_out;
	pthread_t th_com;

	par par;
	par.loop_ok=true;
	par.play=false;
	//par.liste_files=NULL;
	par.full=false;
	par.speed = 5;

//create the two threads
	pthread_create(&th_out, NULL, out_main, (void*)&par);	//the first for the drawings (with the SDL)
	pthread_create(&th_com, NULL, com_main, (void*)&par);	//the second for the command (with GTK+)

	pthread_join(th_com, NULL); 
	par.loop_ok=false;	//if the command thread is terminated, the second have to be ended too.
	pthread_join(th_out, NULL); 

	//l_delList(par.liste_files);	//delete the linked list

	return EXIT_SUCCESS;
}
